package com.hpf.tool.entity;

import java.util.ArrayList;
import java.util.List;

import com.hpf.tool.entity.BaseEntity;
/**
 * 
 * @author hpf
 *
 */
public class TreeEntity<T extends BaseEntity> extends BaseEntity{

	/**
	 * 
	 */
	private static final long serialVersionUID = -3175482283011086060L;

	/**
	 * 当前节点是否选中
	 */
	private boolean checked;
	private T resource;
	/**
	 * 子节点数组数据
	 */
	private List<TreeEntity<T>> children;

	public boolean isChecked() {
		return checked;
	}

	public void setChecked(boolean checked) {
		this.checked = checked;
	}

	public T getResource() {
		return resource;
	}

	public void setResource(T resource) {
		this.resource = resource;
	}

	public List<TreeEntity<T>> getChildren() {
		return children;
	}

	public void setChildren(List<TreeEntity<T>> children) {
		this.children = children;
	}

	public void appendChildren(TreeEntity<T> tree) {
		if(this.children == null) {
			this.children = new ArrayList<TreeEntity<T>>();
		}
		this.children.add(tree);
	}
}
